#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#define FILE_NAME "bite"
int main()
{
    int fd = open(FILE_NAME,O_RDONLY);
    char buffer[1024]={0};
    int num = read(fd,buffer,sizeof(buffer)-1);
    if(num > 0)
    {
        buffer[num]=0;
        printf("%s",buffer);
    }
    //umask(0);
    //int fd = open(FILE_NAME,O_WRONLY | O_CREAT,0666);
    //
    //int cnt = 5;
    //char buffer[64]={0};
    //while(cnt)
    //{
    //    sprintf(buffer,"%s:%d\n","I like Linux",cnt--);
    //    write(fd,buffer,strlen(buffer));
    //}
    close(fd);
    return 0;
}
